package com.tencent.qf.team.controller;

import com.alibaba.fastjson.JSON;
import com.tencent.qf.common.pojo.HttpResult;
import com.tencent.qf.team.dto.response.TySceneChannelDto;
import com.tencent.qf.team.service.SceneChannelService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class SceneChannelController {

    @Autowired
    private SceneChannelService sceneChannelService;

    @PostMapping("/api/team/sceneChannelList")
    @ApiOperation("成交渠道列表")
    public HttpResult<List<TySceneChannelDto>> sceneChannelList() {
        log.info("成交渠道列表");
        List<TySceneChannelDto> data = sceneChannelService.sceneChannelList();
        HttpResult<List<TySceneChannelDto>> result = HttpResult.success(data);
        log.info("成交渠道列表，出参：{}", JSON.toJSONString(result));
        return result;
    }
}
